<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html >
<head>
    <meta charset="UTF-8">
    <title th:text="#{contests} + ' - Online Judge'"></title>
    <meta http-equiv="keywords" content="ACM,OJ,OnlineJudge,JAVA,C++,HappyOJ,IDE,在线判题系统,在线IDE">
    <meta http-equiv="description" content="Topic of Online Judge System for ACM">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" th:href="@{/css/styles.css}" >
    <script th:src="@{/js/jquery-1.7.2.js}"></script>
    <script th:src="@{/js/gdoj.js}"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            OnlineJudge.countdown();
        });
    </script>
</head>
<body>
<div th:replace="common::web-navbar"></div>
<div class="container">
    <div class="content">
        <div class="content-with-sidebar"> 	 <!-- class="content-with-sidebar" -->
            <div id="nav-content" >
                <a th:href="@{/contests}" class="current">[[#{contests}]]</a>
                <a th:href="@{/contests/events}">[[#{recent-contest}]]</a>
                <a th:href="@{/admin/contest/new}" th:if="${session.session_user_admin}">[[#{contest.new}]]</a>
            </div>
            <div class="">
                <div class="roundbox-title ">
                    #[[#{runningorpendingcontests}]]
                </div>
                <table class="contest contest_local_upcoming">
                    <tr class="header">
                        <th class="title left-item">[[#{contesttitle}]]</th>
                        <th class="start">[[#{starttime}]]</th>
                        <th class="during">[[#{during}]]</th>
                        <th class="info" >[[#{contest.status}]]</th>
                        <th class="reg">[[#{contest.registration}]]</th>
                        <th class="oper" th:if="${session.session_user_admin}">[[#{admin}]]</th>
                    </tr>
                    <tr th:if="${unfinshContest.size == 0}"><td class="left-item dark" colspan="15" style="text-align: left;">[[#{no-record}]]</td></tr>
                    <tr th:each="contest,stat : ${unfinshContest.list}" th:class="${stat.even}?'dark'">
                        <td class="title left-item" th:if="${session.session_user_admin}">
                            <a th:href="@{/contest/{contestId}(contestId=${contest.contest_id})}"><span th:text="${contest.title}"></span></a>
                        </td>
                        <td class="title left-item" th:if="${session.session_user_admin!=true&&contest.status != 'RUNNING'}">
                            <span th:if="${contest.defunct!='N'}" th:title="#{problem.invisible}" >
                                    <svg class="problem-disable" viewBox="0 0 1024 1024" p-id="29660"><path d="M253.6 679.2l109.6-109.6C356 552 352 532.8 352 512c0-88 72-160 160-160 20.8 0 40 4 57.6 11.2l82.4-82.4C607.2 264.8 560 256 512 256c-168 0-329.6 106.4-384 256 24 65.6 68.8 123.2 125.6 167.2z" p-id="29661" fill="#bfbfbf"></path><path d="M416 512v4.8L516.8 416H512c-52.8 0-96 43.2-96 96zM770.4 344.8l163.2-163.2L888 136l-753.6 753.6 45.6 45.6 192.8-192.8A390.4 390.4 0 0 0 512 768c167.2 0 330.4-106.4 384.8-256-24-65.6-69.6-123.2-126.4-167.2zM512 672c-20 0-40-4-57.6-11.2l53.6-53.6h4.8c52.8 0 96-43.2 96-96v-4.8l53.6-53.6C668 472 672 492 672 512c0 88-72 160-160 160z" p-id="29662" fill="#bfbfbf"></path></svg>
                            </span>
                            <span th:text="${contest.title}"></span>
                        </td>
                        <td class="title left-item" th:if="${session.session_user_admin!=true&&contest.status == 'RUNNING'}">
                            <span th:if="${contest.defunct!='N'}" th:title="#{problem.invisible}" >
                                    <svg class="problem-disable" viewBox="0 0 1024 1024" p-id="29660"><path d="M253.6 679.2l109.6-109.6C356 552 352 532.8 352 512c0-88 72-160 160-160 20.8 0 40 4 57.6 11.2l82.4-82.4C607.2 264.8 560 256 512 256c-168 0-329.6 106.4-384 256 24 65.6 68.8 123.2 125.6 167.2z" p-id="29661" fill="#bfbfbf"></path><path d="M416 512v4.8L516.8 416H512c-52.8 0-96 43.2-96 96zM770.4 344.8l163.2-163.2L888 136l-753.6 753.6 45.6 45.6 192.8-192.8A390.4 390.4 0 0 0 512 768c167.2 0 330.4-106.4 384.8-256-24-65.6-69.6-123.2-126.4-167.2zM512 672c-20 0-40-4-57.6-11.2l53.6-53.6h4.8c52.8 0 96-43.2 96-96v-4.8l53.6-53.6C668 472 672 492 672 512c0 88-72 160-160 160z" p-id="29662" fill="#bfbfbf"></path></svg>
                            </span>
                            <span th:text="${contest.title}"></span><br/>
                            <span style="font-size:10px;">
                                <span th:if="${session.session_username != null}">
                                    <span th:if="${contest.isRegister == 'Y'}">
                                        <a th:href="@{/contest/{contestId}(contestId=${contest.contest_id})}">[[#{contest.enter}]] &raquo;</a>
                                    </span>
                                    <span th:if="${contest.isRegister != 'Y'}">
                                        <span style="font-size:10px;color:grey" th:if="${contest.regStatus == 'ENDED'}">[[#{contest.tip_miss_the_contest_reg}]]</span>
                                        <span style="font-size:10px;color:grey" th:if="${contest.regStatus != 'ENDED'}">[[#{contest.tip_must_register_first}]]</span>
                                    </span>
                                </span>
                                <span th:if="${session.session_username == null}" style="color:grey">[[#{contest.tip_must_register_first}]]</span>
                            </span>
                        </td>
                        <td class="start" th:text="${#dates.format(contest.start_time,'yyyy-MM-dd HH:mm')}"></td>
                        <td class="during" th:text="${contest.during}"></td>
                        <td class="info" th:title="'From ' + ${#dates.format(contest.start_time,'yyyy-MM-dd HH:mm')} + ' to ' + ${#dates.format(contest.end_time,'yyyy-MM-dd HH:mm')}">
                            <span th:if="${contest.status == 'PENDING'}">
                                [[#{contest.status_before_start}]]&nbsp;<span style="color:grey" class="countdown"><span th:title="${contest.leftTime}" th:text="${contest.friendlyLeftTime}"></span></span>
                            </span>
                            <span th:if="${contest.status == 'RUNNING'}">
                                <span style=""><a th:href="@{/contest/{contestId}/standings(contestId=${contest.contest_id})}">[[#{contest.current_standing}]]</a></span><br/>
		            			[[#{contest.util_close}]]&nbsp;<span style="color:grey" class="countdown"><span th:title="${contest.leftTime}" th:text="${contest.friendlyLeftTime}"></span></span>
                            </span>
                            <span th:if="${contest.status == 'ENDED'}" style="color:grey;"><b>[[#{contest.status_end}]]</b></span>
                        </td>
                        <td class="reg" th:title="'From ' + ${#dates.format(contest.start_reg,'yyyy-MM-dd HH:mm')} + ' to ' + ${#dates.format(contest.end_reg,'yyyy-MM-dd HH:mm')}">
                            <span class="link-to-contest" style="">
                                <span th:if="${contest.regStatus == 'ENDED'}">
                                    <a th:href="@{/contest/{contestId}/registrants(contestId=${contest.contest_id})}" title="The num of registrants" th:text="${contest.registrants}"></a><br/>
                                    <font style="color:grey">[[#{contest.reg_end}]]</font>
                                </span>
                                <span th:if="${contest.regStatus == 'PENDING'}">
                                    [[#{contest.reg_before_start}]]&nbsp;<span style="color:grey" class="countdown"><span th:title="${contest.regleftTime}" th:text="${contest.friendlyRegleftTime}"></span></span>
                                </span>
                                <span th:if="${contest.regStatus == 'RUNNING'}">
                                    <span th:if="${session.session_username != null}">
                                        <span th:if="${contest.isRegister == 'Y'}">
                                            <b><font style="color: red">[[#{contest.reg_success}]]</font></b>
                                        </span>
                                         <span th:if="${contest.isRegister != 'Y'}">
                                             <b><a th:href="@{/contest/{contestId}/register(contestId=${contest.contest_id})}" th:class="'reg ' + ${contest.contest_id}">[[#{contest.reg_contest}]]&raquo;</a></b>
                                        </span>
                                    </span>
                                    <span th:if="${session.session_username == null}">
                                        <b><a th:href="@{/contest/{contestId}/register(contestId=${contest.contest_id})}" class="reg">[[#{contest.reg_contest}]]&raquo;</a></b>
                                    </span>
                                    <a th:href="@{/contest/{contestId}/registrants(contestId=${contest.contest_id})}"  title="The num of registrants" th:text="${contest.registrants}"></a>
                                    <br/>
			            			[[#{contest.util_close}]] &nbsp;<span style="color:grey;" class="countdown"><span th:title="${contest.regleftTime}" th:text="${contest.friendlyRegleftTime}"></span></span>
                                </span>
                            </span>
                        </td>
                        <td class="oper" th:if="${session.session_user_admin}">
                            <a th:href="@{/admin/contest/edit/{contestId}(contestId=${contest.contest_id})}" th:title="edit">
                                <svg class="icon-svg" viewBox="0 0 1024 1024"><path d="M362.971 660.371l139.518-34.873 458.43-458.429L856.274 62.436l-458.43 458.43-34.873 139.505z m104.645-139.505l390.659-386.671 32.886 32.874-388.672 388.669-69.759 34.886 34.886-69.758z" p-id="5438" fill="#8a8a8a"></path><path d="M833.422 512c-17.678 0-32.009 14.323-32.022 31.997h-0.001v351.722H127.637V223.957h415.561v-0.461c17.424-0.093 31.52-14.242 31.52-31.688s-14.096-31.595-31.52-31.688v-0.004H113.637c-27.524 0-49.84 22.316-49.84 49.84v699.762c0 27.523 22.316 49.839 49.84 49.839h701.762c27.524 0 49.84-22.315 49.84-49.839v-362.1a32.33 32.33 0 0 0 0.206-3.595C865.444 526.337 851.107 512 833.422 512z" p-id="5439" fill="#8a8a8a"></path></svg>
                            </a>
                            <a th:if="${contest.defunct=='N'}" th:href="@{/admin/contest/delete/{contestId}(contestId=${contest.contest_id})}" th:title="delete">
                                <svg class="icon-svg" viewBox="0 0 1024 1024" ><path d="M623.077 748.923c-17.598 0-31.82-14.223-31.82-31.82V367.025c0-17.598 14.222-31.827 31.82-31.827s31.827 14.23 31.827 31.827v350.075c0 17.6-14.228 31.822-31.827 31.822z m-190.945 0c-17.604 0-31.827-14.223-31.827-31.82V367.025c0-17.598 14.223-31.827 31.827-31.827 17.598 0 31.82 14.23 31.82 31.827v350.075c0 17.6-14.222 31.822-31.82 31.822z m509.193-541.02H782.201v-63.65c0-52.64-42.486-95.475-94.742-95.475H368.477c-52.634 0-95.47 42.836-95.47 95.475v63.65H113.885c-17.604 0-31.827 14.222-31.827 31.826 0 17.598 14.223 31.82 31.827 31.82h827.441c17.598 0 31.827-14.222 31.827-31.82 0-17.604-14.228-31.827-31.827-31.827z m-604.669-63.65c0-17.536 14.287-31.826 31.821-31.826H687.46c17.444 0 31.094 13.972 31.094 31.826v63.65H336.656v-63.65z m413.85 795.621H304.892c-52.635 0-95.47-42.836-95.47-95.475V366.55c0-17.569 14.257-31.826 31.822-31.826 17.57 0 31.826 14.257 31.826 31.826V844.4c0 17.569 14.288 31.826 31.823 31.826h445.613c17.565 0 31.823-14.257 31.823-31.826V367.852c0-17.565 14.228-31.823 31.826-31.823 17.599 0 31.827 14.258 31.827 31.823v476.547c0 52.64-42.841 95.475-95.476 95.475z" p-id="4281" fill="#8a8a8a"></path></svg>
                            </a>
                            <a th:if="${contest.defunct!='N'}" th:href="@{/admin/contest/resume/{contestId}(contestId=${contest.contest_id})}" th:title="Resume">
                                <svg class="icon-svg" viewBox="0 0 1024 1024" ><path d="M690 145.3l-70.6 12.4-12.3-69.6c-2.4-13.6-15.4-22.8-29.1-20.4L395.5 100c-13.6 2.4-22.8 15.4-20.4 29.1l12.3 69.6L130.3 244l17.2 97.3 746.2-131.6-17.2-97.3L690 145.3z m-141.3 24.4l-90.8 16-5.8-32.8 90.8-16 5.8 32.8zM187.1 341.6l51.2 516.1c0 54.3 48.6 98.8 108 98.8h331.8c59.9 0 108-44 108-98.8l50.7-516.1H187.1z m549.8 339c-0.3 9.3-7.7 16.7-16.9 17-5 0-9.7-2.3-12.6-6.2l-39-39.5c-98.1 98.1-230.7 107.6-327.6 32.7-23.5-23.4-43.5-44.3-72.3-79.4 162.9 114 297.4-7.2 318.1-34.7l-40.1-38.7h0.1c-4-3-6.3-7.7-6.2-12.7 0-0.6 0-1.2 0.1-1.8 0.9-9.2 9.1-16 18.3-15.1l180.1-19.9c4.6-0.1 9 1.8 12.1 5.3 3.4 3.1 5.4 7.5 5.3 12.1l-19.4 180.9z" p-id="6547" fill="#8a8a8a"></path></svg>
                            </a>
                        </td>
                    </tr>
                </table>
            </div>
            <br>
            <!-- Ended  -->
            <div class="">
                <div class="roundbox-title ">
                    #[[#{endedcontests}]]
                  </div>
                <div>
                    <table class="contest">
                        <tr class="header">
                            <th class="title left-item">[[#{contesttitle}]]</th>
                            <th class="start">[[#{starttime}]]</th>
                            <th class="during">[[#{during}]]</th>
                            <th class="standings">[[#{standings}]]</th>
                            <th class="registrants" title="The num of registrants">=</th>
                            <th class="oper" th:if="${session.session_user_admin}">[[#{admin}]]</th>
                        </tr>
                        <tr th:if="${pageInfo.size == 0}"><td class="left-item dark" colspan="15" style="text-align: left;">[[#{no-record}]]</td></tr>
                        <tr th:each="contest,stat : ${pageInfo.list}" th:class="${stat.even}?'dark'">
                            <td class="title left-item">
                                <span th:if="${contest.defunct!='N'}" th:title="#{problem.invisible}" >
                                    <svg class="problem-disable" viewBox="0 0 1024 1024" p-id="29660"><path d="M253.6 679.2l109.6-109.6C356 552 352 532.8 352 512c0-88 72-160 160-160 20.8 0 40 4 57.6 11.2l82.4-82.4C607.2 264.8 560 256 512 256c-168 0-329.6 106.4-384 256 24 65.6 68.8 123.2 125.6 167.2z" p-id="29661" fill="#bfbfbf"></path><path d="M416 512v4.8L516.8 416H512c-52.8 0-96 43.2-96 96zM770.4 344.8l163.2-163.2L888 136l-753.6 753.6 45.6 45.6 192.8-192.8A390.4 390.4 0 0 0 512 768c167.2 0 330.4-106.4 384.8-256-24-65.6-69.6-123.2-126.4-167.2zM512 672c-20 0-40-4-57.6-11.2l53.6-53.6h4.8c52.8 0 96-43.2 96-96v-4.8l53.6-53.6C668 472 672 492 672 512c0 88-72 160-160 160z" p-id="29662" fill="#bfbfbf"></path></svg>
                                </span>
                                <a th:href="@{/contest/{contestId}(contestId=${contest.contest_id})}" th:text="${contest.title}"></a>
                            </td>
                            <td class="start" th:text="${#dates.format(contest.start_time,'yyyy-MM-dd HH:mm')}"></td>
                            <td class="during"
                                th:title="${#dates.format(contest.start_time,'yyyy-MM-dd HH:mm')} + ' ' + ${#dates.format(contest.end_time,'yyyy-MM-dd HH:mm')}"
                                th:text="${contest.during}">
                            </td>
                            <td class="standings"><a th:href="@{/contest/{contestId}/standings(contestId=${contest.contest_id})}">[[#{contest.final_standing}]]</a> </td>
                            <td class="registrants"><a th:href="@{/contest/{contestId}/registrants(contestId=${contest.contest_id})}" th:text="${contest.attendList.size}"></a></td>
                            <td class="oper" th:if="${session.session_user_admin}">
                                <a th:href="@{/admin/contest/edit/{contestId}(contestId=${contest.contest_id})}" th:title="edit">
                                    <svg class="icon-svg" viewBox="0 0 1024 1024"><path d="M362.971 660.371l139.518-34.873 458.43-458.429L856.274 62.436l-458.43 458.43-34.873 139.505z m104.645-139.505l390.659-386.671 32.886 32.874-388.672 388.669-69.759 34.886 34.886-69.758z" p-id="5438" fill="#8a8a8a"></path><path d="M833.422 512c-17.678 0-32.009 14.323-32.022 31.997h-0.001v351.722H127.637V223.957h415.561v-0.461c17.424-0.093 31.52-14.242 31.52-31.688s-14.096-31.595-31.52-31.688v-0.004H113.637c-27.524 0-49.84 22.316-49.84 49.84v699.762c0 27.523 22.316 49.839 49.84 49.839h701.762c27.524 0 49.84-22.315 49.84-49.839v-362.1a32.33 32.33 0 0 0 0.206-3.595C865.444 526.337 851.107 512 833.422 512z" p-id="5439" fill="#8a8a8a"></path></svg>
                                </a>
                                <a th:if="${contest.defunct=='N'}" th:href="@{/admin/contest/delete/{contestId}(contestId=${contest.contest_id})}" th:title="delete">
                                    <svg class="icon-svg" viewBox="0 0 1024 1024" ><path d="M623.077 748.923c-17.598 0-31.82-14.223-31.82-31.82V367.025c0-17.598 14.222-31.827 31.82-31.827s31.827 14.23 31.827 31.827v350.075c0 17.6-14.228 31.822-31.827 31.822z m-190.945 0c-17.604 0-31.827-14.223-31.827-31.82V367.025c0-17.598 14.223-31.827 31.827-31.827 17.598 0 31.82 14.23 31.82 31.827v350.075c0 17.6-14.222 31.822-31.82 31.822z m509.193-541.02H782.201v-63.65c0-52.64-42.486-95.475-94.742-95.475H368.477c-52.634 0-95.47 42.836-95.47 95.475v63.65H113.885c-17.604 0-31.827 14.222-31.827 31.826 0 17.598 14.223 31.82 31.827 31.82h827.441c17.598 0 31.827-14.222 31.827-31.82 0-17.604-14.228-31.827-31.827-31.827z m-604.669-63.65c0-17.536 14.287-31.826 31.821-31.826H687.46c17.444 0 31.094 13.972 31.094 31.826v63.65H336.656v-63.65z m413.85 795.621H304.892c-52.635 0-95.47-42.836-95.47-95.475V366.55c0-17.569 14.257-31.826 31.822-31.826 17.57 0 31.826 14.257 31.826 31.826V844.4c0 17.569 14.288 31.826 31.823 31.826h445.613c17.565 0 31.823-14.257 31.823-31.826V367.852c0-17.565 14.228-31.823 31.826-31.823 17.599 0 31.827 14.258 31.827 31.823v476.547c0 52.64-42.841 95.475-95.476 95.475z" p-id="4281" fill="#8a8a8a"></path></svg>
                                </a>
                                <a th:if="${contest.defunct!='N'}" th:href="@{/admin/contest/resume/{contestId}(contestId=${contest.contest_id})}" th:title="Resume">
                                    <svg class="icon-svg" viewBox="0 0 1024 1024" ><path d="M690 145.3l-70.6 12.4-12.3-69.6c-2.4-13.6-15.4-22.8-29.1-20.4L395.5 100c-13.6 2.4-22.8 15.4-20.4 29.1l12.3 69.6L130.3 244l17.2 97.3 746.2-131.6-17.2-97.3L690 145.3z m-141.3 24.4l-90.8 16-5.8-32.8 90.8-16 5.8 32.8zM187.1 341.6l51.2 516.1c0 54.3 48.6 98.8 108 98.8h331.8c59.9 0 108-44 108-98.8l50.7-516.1H187.1z m549.8 339c-0.3 9.3-7.7 16.7-16.9 17-5 0-9.7-2.3-12.6-6.2l-39-39.5c-98.1 98.1-230.7 107.6-327.6 32.7-23.5-23.4-43.5-44.3-72.3-79.4 162.9 114 297.4-7.2 318.1-34.7l-40.1-38.7h0.1c-4-3-6.3-7.7-6.2-12.7 0-0.6 0-1.2 0.1-1.8 0.9-9.2 9.1-16 18.3-15.1l180.1-19.9c4.6-0.1 9 1.8 12.1 5.3 3.4 3.1 5.4 7.5 5.3 12.1l-19.4 180.9z" p-id="6547" fill="#8a8a8a"></path></svg>
                                </a>
                            </td>
                        </tr>
                    </table>
                    <div style="margin:6px 12px;font-size:15px;">
                        <div class="left"></div>
                        <div class="right">
                            <a th:if="${pageInfo.hasPreviousPage == true}" th:href="@{/contests/page/{pageNum}(pageNum=${pageInfo.prePage})}" style="color:#000;text-decoration: none;">&larr;</a>
                            <a th:if="${pageInfo.firstPage > 1}" th:href="@{/contests/page/1}" style="color:#000;text-decoration: none;">1</a>
                            <span th:if="${pageInfo.firstPage > 2}"  >...</span>
                            <span th:each="nav:${pageInfo.navigatepageNums}">
                                <a th:href="@{/contests/page/{pageNum}(pageNum=${nav})}" th:text="${nav}" th:if="${nav == pageInfo.pageNum}" style="font-weight: bold;color:#000;text-decoration: none;"></a>
                                <a th:href="@{/contests/page/{pageNum}(pageNum=${nav})}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}" style="color:#000;text-decoration: none;"></a>
                            </span>
                            <span th:if="${pageInfo.lastPage < pageInfo.pages}" >...</span>
                            <a th:if="${pageInfo.pages > pageInfo.lastPage}" th:href="@{/contests/page/{pageNum}(pageNum=${pageInfo.pages})}" th:text="${pageInfo.pages}" style="color:#000;text-decoration: none;"></a>
                            <a th:if="${pageInfo.hasNextPage == true}" th:href="@{/contests/page/{pageNum}(pageNum=${pageInfo.nextPage})}" style="color:#000;text-decoration: none;">&rarr;</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="sidebar" th:replace="sidebar::web-sidebar"></div>
    </div>
    <div th:replace="common::web-footer"></div>
</div>
</body>
</html>
